import request from "./request.js";

//登录
export function login(data) {
  return request({
    method: "post",
    url: "/login",
    data
  });
}

//获取左侧菜单
export function getMenus(data) {
  return request({
    method: "get",
    url: "/menus",
    params: data
  });
}

//获取角色列表
export function getUsers(data) {
  return request({
    method: "get",
    url: "/users",
    params: data
  });
}

//添加用户
export function AddUsers(data) {
  return request({
    method: "post",
    url: "/users",
    data
  });
}

//编辑用户提交
export function EditUsers(data) {
  return request({
    method: "put",
    url: "/users/" + data.id,
    data
  });
}

//删除单个用户
export function DeleteUsers(data) {
  return request({
    method: "delete",
    url: "/users/" + data.id,
    data
  });
}

//所有权限列表
export function DeleteUsers(data) {
  return request({
    method: "get",
    url: "rights/list",
    params: data
  });
}
